package cn.dgut.Entity;

public class Course {
    private int course_id;
    private int tid;
    private String course_name;
    private int hours;
    private String type;
    private String course_begin;
    private int course_pay;
    private String cinfo;
    private int isSell;

    public Course() {
    }

    public Course(int course_id, int tid, String course_name, int hours, String type, String course_begin, int course_pay, String cinfo, int isSell) {
        this.course_id = course_id;
        this.tid = tid;
        this.course_name = course_name;
        this.hours = hours;
        this.type = type;
        this.course_begin = course_begin;
        this.course_pay = course_pay;
        this.cinfo = cinfo;
        this.isSell = isSell;
    }

    public int getIsSell() {
        return isSell;
    }

    public void setIsSell(int isSell) {
        this.isSell = isSell;
    }

    public int getCourse_id() {
        return course_id;
    }

    public void setCourse_id(int course_id) {
        this.course_id = course_id;
    }

    public int getTid() {
        return tid;
    }

    public void setTid(int tid) {
        this.tid = tid;
    }

    public String getCourse_name() {
        return course_name;
    }

    public void setCourse_name(String course_name) {
        this.course_name = course_name;
    }

    public int getHours() {
        return hours;
    }

    public void setHours(int hours) {
        this.hours = hours;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCourse_begin() {
        return course_begin;
    }

    public void setCourse_begin(String course_begin) {
        this.course_begin = course_begin;
    }

    public int getCourse_pay() {
        return course_pay;
    }

    public void setCourse_pay(int course_pay) {
        this.course_pay = course_pay;
    }

    public String getCinfo() {
        return cinfo;
    }

    public void setCinfo(String cinfo) {
        this.cinfo = cinfo;
    }

    @Override
    public String toString() {
        cinfo = cinfo.replace("\"","'");
        String temp = course_begin.trim();
        temp = temp.substring(0,16).replace(' ','T');
        return "{" +
                "\"name1\":\"" + course_name  +
                "\",\"name2\":\"" + tid  +
                "\",\"name3\":\"" + hours  +
                "\",\"name4\":\"" + type  +
                "\",\"name5\":\"" + temp  +
                "\",\"name6\":\"" + course_pay  +
                "\",\"name7\":\"" + cinfo  +
                "\",\"name8\":\"" + isSell +
                "\"}";
    }
}
